<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>toRefs</title>
</head>
<body>
  <script type="module">
    import { reactive, toRefs, effect } from '../dist/index.js' 

    const useProduction = () => {
        const production = reactive({
            name: 'iPhone',
            price: 5000,
            count: 3,
        })
        return toRefs(production)
    }

    const { price, count } = useProduction()

    let total = 0
    effect(() => {
        total = price.value * count.value
    })
    console.log(total)
    
    price.value = 4000
    console.log(total)

    count.value = 1
    console.log(total)
  </script>
</body>
</html>